﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SLTimeSystem
{
    public class FrameAgent : TimerAgentBase
    {
        public override void CheckTime()
        {
            DebugUtils.Log("FrameAgent" + CurTime);
            CurTime++;
            if (CurTime-1 >= TargetTime
                && CurRepeatCount < RepeatCount)
            {
                if (OnTrigger != null)
                {
                    OnTrigger();
                }
                CurRepeatCount++;
                CurTime = 0;
                if (CurRepeatCount >= RepeatCount)
                {
                    IsTimeOver = true;
                    //Agents.Remove(Agents[i]);
                    //i--;
                }
            }
        }
    }
}
